import java.text.SimpleDateFormat;
import java.util.Random;

public class DateTimeTest {
	public static String getCurrDateTime(String strFormatTo) {
		java.sql.Timestamp date = new java.sql.Timestamp(
				System.currentTimeMillis());
		SimpleDateFormat formatter = new SimpleDateFormat(strFormatTo);
		return formatter.format(date);
	}

	public static void main(String[] args) {
		Random r = new Random();
		System.out.println(System.currentTimeMillis() + "_" + r.nextInt() + "_"
				+ Math.random());
		System.out.println(getCurrDateTime("yyyyMMddHHmmss"));
		System.out.println(DateTimeTest.class.getSimpleName());
	}
}
